how to add string to all values of column in pandas

38

how to add string to all values of column in pandas -

>>> df = pd.DataFrame({'col':['a',0]})
>>> df
  col
0   a
1   0
>>> df['col'] = 'str' + df['col'].astype(str)
>>> df
    col
0  stra
1  str0

Comments

Submit
0 Comments